# Maintainer: Bruno Pagani <archange@archlinux.org>

pkgname=python-poppler-qt5
pkgver=21.3.0
pkgrel=2
pkgdesc="Python binding to libpoppler-qt5"
arch=(loong64 x86_64)
url="https://github.com/frescobaldi/python-poppler-qt5"
license=(LGPL)
depends=(qt5-base poppler-qt5 python-pyqt5)
makedepends=(pyqt-builder sip)
source=(${url}/archive/v${pkgver}/${pkgname}-${pkgver}.tar.gz)
sha256sums=('dbf3be9c8123429c8a73ebd4c18993331619198e88fa40dde99f48213fa75012')

build() {
  cd ${pkgname}-${pkgver}
  sip-build
}

package() {
  cd ${pkgname}-${pkgver}
  local site_packages=$(python -c "import site; print(site.getsitepackages()[0])")
  sip-install --target-dir="${pkgdir}"${site_packages}
}
